package Controller;

import model.AirConditioner;
import model.BackYard;
import model.BackYardSoundSystem;
import model.CD;
import model.CeilingFan;
import model.Garage;
import model.LivingRoom;
import model.Radio;
import model.Stereo;

/**
 *
 * @author elias
 */
public class CommandFactory {

    public Command fabricar(String nome){
        Command retorno = ( nome.equals("air ON" ) ) ? new CommandAirConditionerON(new AirConditioner()):
                            nome.equals("air OFF")? new CommandAirConditionerOFF(new AirConditioner()):
                            nome.equals("back yard light ON")? new CommandBackYardLightON(new BackYard()):
                            nome.equals("back yard light OFF")? new CommandBackYardLightOFF(new BackYard()):
                            nome.equals("back yard sound ON")? new CommandBackYardSoundSystemON(new BackYardSoundSystem()):
                            nome.equals("back yard sound OFF")? new CommandBackYardSoundSystemOFF(new BackYardSoundSystem()):
                            nome.equals("ceiling fan ON")? new CommandCeilingFanON(new CeilingFan()):
                            nome.equals("ceiling fan OFF")? new CommandCeilingFanOFF(new CeilingFan()):
                            nome.equals("garage light ON")? new CommandGarageLightON(new Garage()):
                            nome.equals("garage light OFF")? new CommandGarageLightOFF(new Garage()):
                            nome.equals("living room light ON")? new CommandLivingRoomLightON(new LivingRoom()):
                            nome.equals("living room light OFF")? new CommandLivingRoomLightOFF(new LivingRoom()):
                            nome.equals("stereo ON with cd")? new CommandStereoONWithCD(new Stereo(), new CD()):
                            nome.equals("stereo OFF with radio")? new CommandStereoOFFWithRadio(new Stereo(), new Radio()):
                            nome.equals("stereo ON with radio")? new CommandStereoONWithRadio(new Stereo(), new Radio()):
                            nome.equals("stereo OFF with cd")? new CommandStereoOFFWithCD(new Stereo(), new CD()):
                            nome.equals("party mode ON") ? new macroCommandPartyMode():
                                null;
        /*if ( nome.equals("air ON"))
            retorno = new CommandAirConditionerON(new AirConditioner());
        if ( nome)*/
        return retorno;
    }

}
